home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / QuickTime Mac / AIncludes / QD3DRenderer.a < prev    next >
Encoding:
Text File  |  1998-04-09  |  40.5 KB  |  1,271 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QD3DRenderer.a
  3. ;
  4. ;    Contains:    Q3Renderer types and routines                                          
  5. ;
  6. ;    Version:    Technology:    Quickdraw 3D 1.5.4
  7. ;                Release:    QuickTime 3.0
  8. ;
  9. ;    Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__QD3DRENDERER__') = 'UNDEFINED' THEN
  19. __QD3DRENDERER__ SET 1
  20.  
  21.     IF &TYPE('__QD3D__') = 'UNDEFINED' THEN
  22.     include 'QD3D.a'
  23.     ENDIF
  24.     IF &TYPE('__QD3DSET__') = 'UNDEFINED' THEN
  25.     include 'QD3DSet.a'
  26.     ENDIF
  27.     IF &TYPE('__QD3DVIEW__') = 'UNDEFINED' THEN
  28.     include 'QD3DView.a'
  29.     ENDIF
  30.  
  31.     IF TARGET_OS_MAC THEN
  32.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  33.     include 'Events.a'
  34.     ENDIF
  35.     ENDIF    ; TARGET_OS_MAC
  36. ; ******************************************************************************
  37. ; **                                                                             **
  38. ; **                            User Interface Things                             **
  39. ; **                                                                             **
  40. ; ****************************************************************************
  41.  
  42.     IF TARGET_OS_MAC THEN
  43. ; *  A callback to an application's event handling code. This is needed to    
  44. ; *  support movable modal dialogs. The dialog's event filter calls this      
  45. ; *  callback with events it does not handle.                                 
  46. ; *  If an application handles the event it should return kQ3True.            
  47. ; *  If the application does not handle the event it must return kQ3False and 
  48. ; *  the dialog's event filter will pass the event to the system unhandled.   
  49.  
  50. TQ3DialogAnchor            RECORD 0
  51. clientEventHandler         ds.l    1                ; offset: $0 (0)
  52. sizeof                     EQU *                    ; size:   $4 (4)
  53.                         ENDR
  54.     ENDIF    ; TARGET_OS_MAC
  55.     IF TARGET_OS_WIN32 THEN
  56. TQ3DialogAnchor            RECORD 0
  57. ownerWindow                 ds.l    1                ; offset: $0 (0)
  58. sizeof                     EQU *                    ; size:   $4 (4)
  59.                         ENDR
  60.     ENDIF    ; TARGET_OS_WIN32
  61.     IF TARGET_OS_UNIX THEN
  62. TQ3DialogAnchor            RECORD 0
  63. notUsed                     ds.l    1                ; offset: $0 (0)        ;  place holder 
  64. sizeof                     EQU *                    ; size:   $4 (4)
  65.                         ENDR
  66.     ENDIF    ; TARGET_OS_UNIX
  67. ; ******************************************************************************
  68. ; **                                                                             **
  69. ; **                            Renderer Functions                                 **
  70. ; **                                                                             **
  71. ; ****************************************************************************
  72.  
  73. ;
  74. ; extern TQ3RendererObject Q3Renderer_NewFromType(TQ3ObjectType rendererObjectType)
  75. ;
  76.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  77.         IMPORT_CFM_FUNCTION Q3Renderer_NewFromType
  78.     ENDIF
  79.  
  80. ;
  81. ; extern TQ3ObjectType Q3Renderer_GetType(TQ3RendererObject renderer)
  82. ;
  83.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  84.         IMPORT_CFM_FUNCTION Q3Renderer_GetType
  85.     ENDIF
  86.  
  87.  
  88. ;  Q3Renderer_Flush has been replaced by Q3View_Flush 
  89. ;  Q3Renderer_Sync has been replaced by Q3View_Sync 
  90.  
  91. ; *    Q3Renderer_IsInteractive
  92. ; *        Determine if this renderer is intended to be used interactively.
  93.  
  94. ;
  95. ; extern TQ3Boolean Q3Renderer_IsInteractive(TQ3RendererObject renderer)
  96. ;
  97.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  98.         IMPORT_CFM_FUNCTION Q3Renderer_IsInteractive
  99.     ENDIF
  100.  
  101.  
  102. ; *    Q3Renderer_HasModalConfigure
  103. ; *        Determine if this renderer has a modal settings dialog.
  104. ; *
  105. ; *    Q3Renderer_ModalConfigure
  106. ; *        Have the renderer pop up a modal dialog box to configure its settings.
  107. ; *    dialogAnchor - is platform specific data passed by the client to support
  108. ; *      movable modal dialogs. 
  109. ; *    MacOS: this is a callback to the calling application's event handler.
  110. ; *      The renderer calls this function with events not handled by the 
  111. ; *      settings dialog. This is necessary in order to support movable modal 
  112. ; *      dialogs. An application's event handler must return kQ3True if it 
  113. ; *      handles the event passed to the callback or kQ3False if not. 
  114. ; *      An application which doesn't want to support a movable modal configure
  115. ; *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  116. ; *    Win32: this is the HWND of the owning window (typically an application's
  117. ; *      main window).
  118. ; *  canceled - returns a boolean inditacating that the user canceled the 
  119. ; *    dialog.
  120. ; *      
  121.  
  122. ;
  123. ; extern TQ3Boolean Q3Renderer_HasModalConfigure(TQ3RendererObject renderer)
  124. ;
  125.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  126.         IMPORT_CFM_FUNCTION Q3Renderer_HasModalConfigure
  127.     ENDIF
  128.  
  129. ;
  130. ; extern TQ3Status Q3Renderer_ModalConfigure(TQ3RendererObject renderer, TQ3DialogAnchor dialogAnchor, TQ3Boolean *canceled)
  131. ;
  132.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  133.         IMPORT_CFM_FUNCTION Q3Renderer_ModalConfigure
  134.     ENDIF
  135.  
  136. ; *    Q3RendererClass_GetNickNameString
  137. ; *        Allows an application to get a renderers name string, the 
  138. ; *        renderer is responsible for storing this in a localizable format
  139. ; *        for example as a resource.  This string can then be used to provide
  140. ; *        a selection mechanism for an application (for example in a menu).
  141. ; *
  142. ; *        If this call returns nil in the supplied string, then the App may 
  143. ; *         choose to use the class name for the renderer.  You should always 
  144. ; *        try to get the name string before using the class name, since the
  145. ; *        class name is not localizable.
  146.  
  147. ;
  148. ; extern TQ3Status Q3RendererClass_GetNickNameString(TQ3ObjectType rendererClassType, TQ3ObjectClassNameString rendererClassString)
  149. ;
  150.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  151.         IMPORT_CFM_FUNCTION Q3RendererClass_GetNickNameString
  152.     ENDIF
  153.  
  154.  
  155. ; *    Q3Renderer_GetConfigurationData
  156. ; *        Allows an application to collect private renderer configuration data
  157. ; *      which it will then save. For example in a preference file or in a 
  158. ; *        style template. An application should tag this data with the 
  159. ; *        Renderer's object  name.
  160. ; *    
  161. ; *        if dataBuffer is NULL actualDataSize returns the required size in 
  162. ; *        bytes of a data buffer large enough to store private data. 
  163. ; *
  164. ; *      bufferSize is the actual size of the memory block pointed to by 
  165. ; *        dataBuffer
  166. ; *
  167. ; *        actualDataSize - on return the actual number of bytes written to the 
  168. ; *        buffer or if dataBuffer is NULL the required size of dataBuffer
  169. ; * 
  170.  
  171. ;
  172. ; extern TQ3Status Q3Renderer_GetConfigurationData(TQ3RendererObject renderer, unsigned char *dataBuffer, unsigned long bufferSize, unsigned long *actualDataSize)
  173. ;
  174.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  175.         IMPORT_CFM_FUNCTION Q3Renderer_GetConfigurationData
  176.     ENDIF
  177.  
  178. ;
  179. ; extern TQ3Status Q3Renderer_SetConfigurationData(TQ3RendererObject renderer, unsigned char *dataBuffer, unsigned long bufferSize)
  180. ;
  181.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  182.         IMPORT_CFM_FUNCTION Q3Renderer_SetConfigurationData
  183.     ENDIF
  184.  
  185.  
  186.  
  187. ; ******************************************************************************
  188. ; **                                                                             **
  189. ; **                        Interactive Renderer Specific Functions                 **
  190. ; **                                                                             **
  191. ; ****************************************************************************
  192.  
  193. ;  CSG IDs attribute 
  194. ;  Object IDs, to be applied as attributes on geometries 
  195.  
  196. kQ3AttributeTypeConstructiveSolidGeometryID EQU 'csgi'
  197.  
  198. kQ3SolidGeometryObjNone            EQU        -1
  199. kQ3SolidGeometryObjA            EQU        0
  200. kQ3SolidGeometryObjB            EQU        1
  201. kQ3SolidGeometryObjC            EQU        2
  202. kQ3SolidGeometryObjD            EQU        3
  203. kQ3SolidGeometryObjE            EQU        4
  204. ;  Possible CSG equations 
  205.  
  206. ; typedef long                            TQ3CSGEquation
  207. kQ3CSGEquationAandB                EQU        $88888888
  208. kQ3CSGEquationAandnotB            EQU        $22222222
  209. kQ3CSGEquationAanBonCad            EQU        $2F222F22
  210. kQ3CSGEquationnotAandB            EQU        $44444444
  211. kQ3CSGEquationnAaBorCanB        EQU        $74747474
  212. ;
  213. ; extern TQ3Status Q3InteractiveRenderer_SetCSGEquation(TQ3RendererObject renderer, TQ3CSGEquation equation)
  214. ;
  215.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  216.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetCSGEquation
  217.     ENDIF
  218.  
  219. ;
  220. ; extern TQ3Status Q3InteractiveRenderer_GetCSGEquation(TQ3RendererObject renderer, TQ3CSGEquation *equation)
  221. ;
  222.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  223.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetCSGEquation
  224.     ENDIF
  225.  
  226. ;
  227. ; extern TQ3Status Q3InteractiveRenderer_SetPreferences(TQ3RendererObject renderer, long vendorID, long engineID)
  228. ;
  229.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  230.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetPreferences
  231.     ENDIF
  232.  
  233. ;
  234. ; extern TQ3Status Q3InteractiveRenderer_GetPreferences(TQ3RendererObject renderer, long *vendorID, long *engineID)
  235. ;
  236.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  237.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetPreferences
  238.     ENDIF
  239.  
  240. ;
  241. ; extern TQ3Status Q3InteractiveRenderer_SetDoubleBufferBypass(TQ3RendererObject renderer, TQ3Boolean bypass)
  242. ;
  243.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  244.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetDoubleBufferBypass
  245.     ENDIF
  246.  
  247. ;
  248. ; extern TQ3Status Q3InteractiveRenderer_GetDoubleBufferBypass(TQ3RendererObject renderer, TQ3Boolean *bypass)
  249. ;
  250.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  251.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetDoubleBufferBypass
  252.     ENDIF
  253.  
  254. ;
  255. ; extern TQ3Status Q3InteractiveRenderer_SetRAVEContextHints(TQ3RendererObject renderer, unsigned long RAVEContextHints)
  256. ;
  257.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  258.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetRAVEContextHints
  259.     ENDIF
  260.  
  261. ;
  262. ; extern TQ3Status Q3InteractiveRenderer_GetRAVEContextHints(TQ3RendererObject renderer, unsigned long *RAVEContextHints)
  263. ;
  264.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  265.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetRAVEContextHints
  266.     ENDIF
  267.  
  268. ;
  269. ; extern TQ3Status Q3InteractiveRenderer_SetRAVETextureFilter(TQ3RendererObject renderer, unsigned long RAVEtextureFilterValue)
  270. ;
  271.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  272.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_SetRAVETextureFilter
  273.     ENDIF
  274.  
  275. ;
  276. ; extern TQ3Status Q3InteractiveRenderer_GetRAVETextureFilter(TQ3RendererObject renderer, unsigned long *RAVEtextureFilterValue)
  277. ;
  278.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  279.         IMPORT_CFM_FUNCTION Q3InteractiveRenderer_GetRAVETextureFilter
  280.     ENDIF
  281.  
  282.  
  283. ; ******************************************************************************
  284. ; **                                                                             **
  285. ; **                            Renderer View Tools                                 **
  286. ; **                                                                             **
  287. ; **                    You may only call these methods from a plug-in             **
  288. ; **                                                                             **
  289. ; ****************************************************************************
  290.  
  291. ; *    Call by a renderer to call the user "idle" method, with progress 
  292. ; *    information.
  293. ; *    
  294. ; *    Pass in (view, 0, n) on first call
  295. ; *    Pass in (view, 1..n-1, n) during rendering
  296. ; *    Pass in (view, n, n) upon completion
  297. ; *    
  298. ; *    Note: The user must have supplied an idleProgress method with 
  299. ; *    Q3XView_SetIdleProgressMethod. Otherwise, the generic idle method is
  300. ; *    called with no progress data. e.g. the Q3View_SetIdleMethod method
  301. ; *    is called instead. (current and final are ignored, essentially.)
  302. ; *
  303. ; *    Returns kQ3Failure if rendering is cancelled.
  304.  
  305. ;
  306. ; extern TQ3Status Q3XView_IdleProgress(TQ3ViewObject view, unsigned long current, unsigned long completed)
  307. ;
  308.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  309.         IMPORT_CFM_FUNCTION Q3XView_IdleProgress
  310.     ENDIF
  311.  
  312. ; *    Called by an asynchronous renderer when it completes a frame.
  313.  
  314. ;
  315. ; extern TQ3Status Q3XView_EndFrame(TQ3ViewObject view)
  316. ;
  317.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  318.         IMPORT_CFM_FUNCTION Q3XView_EndFrame
  319.     ENDIF
  320.  
  321.  
  322. ; ******************************************************************************
  323. ; **                                                                             **
  324. ; **                            Renderer AttributeSet Tools                         **
  325. ; **                                                                             **
  326. ; **                    You may only call these methods from a plug-in             **
  327. ; **                                                                             **
  328. ; ****************************************************************************
  329.  
  330. ; *    Faster access to geometry attribute sets.
  331. ; *    
  332. ; *    Returns pointer to INTERNAL data structure for elements and attributes
  333. ; *    in an attributeSet, or NULL if no attribute exists.
  334. ; *    
  335. ; *    For attributes of type kQ3AttributeType..., the internal data structure
  336. ; *    is identical to the data structure used in Q3AttributeSet_Add.
  337.  
  338. ;
  339. ; extern void *Q3XAttributeSet_GetPointer(TQ3AttributeSet attributeSet, TQ3AttributeType attributeType)
  340. ;
  341.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  342.         IMPORT_CFM_FUNCTION Q3XAttributeSet_GetPointer
  343.     ENDIF
  344.  
  345.  
  346.  
  347. kQ3XAttributeMaskNone            EQU        0
  348. kQ3XAttributeMaskSurfaceUV        EQU        $01
  349. kQ3XAttributeMaskShadingUV        EQU        $02
  350. kQ3XAttributeMaskNormal            EQU        $04
  351. kQ3XAttributeMaskAmbientCoefficient EQU    $08
  352. kQ3XAttributeMaskDiffuseColor    EQU        $10
  353. kQ3XAttributeMaskSpecularColor    EQU        $20
  354. kQ3XAttributeMaskSpecularControl EQU    $40
  355. kQ3XAttributeMaskTransparencyColor EQU    $80
  356. kQ3XAttributeMaskSurfaceTangent    EQU        $0100
  357. kQ3XAttributeMaskHighlightState    EQU        $0200
  358. kQ3XAttributeMaskSurfaceShader    EQU        $0400
  359. kQ3XAttributeMaskCustomAttribute EQU    $80000000
  360. kQ3XAttributeMaskAll            EQU        $800007FF
  361. kQ3XAttributeMaskInherited        EQU        $03FF
  362. kQ3XAttributeMaskInterpolated    EQU        $01FF
  363. ; typedef unsigned long                 TQ3XAttributeMask
  364.  
  365. ;
  366. ; extern TQ3XAttributeMask Q3XAttributeSet_GetMask(TQ3AttributeSet attributeSet)
  367. ;
  368.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  369.         IMPORT_CFM_FUNCTION Q3XAttributeSet_GetMask
  370.     ENDIF
  371.  
  372.  
  373. ; ******************************************************************************
  374. ; **                                                                             **
  375. ; **                            Renderer Draw Context Tools                         **
  376. ; **                                                                             **
  377. ; ****************************************************************************
  378.  
  379.  
  380.  
  381. ;
  382. ; extern TQ3Status Q3XDrawContext_GetDrawRegion(TQ3DrawContextObject drawContext, TQ3XDrawRegion *drawRegion)
  383. ;
  384.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  385.         IMPORT_CFM_FUNCTION Q3XDrawContext_GetDrawRegion
  386.     ENDIF
  387.  
  388.  
  389. ; typedef long                            TQ3XDrawContextValidationMasks
  390. kQ3XDrawContextValidationClearFlags EQU    $00000000
  391. kQ3XDrawContextValidationDoubleBuffer EQU $01
  392. kQ3XDrawContextValidationShader    EQU        $02
  393. kQ3XDrawContextValidationClearFunction EQU $04
  394. kQ3XDrawContextValidationActiveBuffer EQU $08
  395. kQ3XDrawContextValidationInternalOffScreen EQU $10
  396. kQ3XDrawContextValidationPane    EQU        $20
  397. kQ3XDrawContextValidationMask    EQU        $40
  398. kQ3XDrawContextValidationDevice    EQU        $80
  399. kQ3XDrawContextValidationWindow    EQU        $0100
  400. kQ3XDrawContextValidationWindowSize EQU    $0200
  401. kQ3XDrawContextValidationWindowClip EQU    $0400
  402. kQ3XDrawContextValidationWindowPosition EQU $0800
  403. kQ3XDrawContextValidationPlatformAttributes EQU $1000
  404. kQ3XDrawContextValidationForegroundShader EQU $2000
  405. kQ3XDrawContextValidationBackgroundShader EQU $4000
  406. kQ3XDrawContextValidationColorPalette EQU $8000
  407. kQ3XDrawContextValidationAll    EQU        $FFFFFFFF
  408. ; typedef unsigned long                 TQ3XDrawContextValidation
  409.  
  410. ;
  411. ; extern TQ3Status Q3XDrawContext_ClearValidationFlags(TQ3DrawContextObject drawContext)
  412. ;
  413.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  414.         IMPORT_CFM_FUNCTION Q3XDrawContext_ClearValidationFlags
  415.     ENDIF
  416.  
  417. ;
  418. ; extern TQ3Status Q3XDrawContext_GetValidationFlags(TQ3DrawContextObject drawContext, TQ3XDrawContextValidation *validationFlags)
  419. ;
  420.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  421.         IMPORT_CFM_FUNCTION Q3XDrawContext_GetValidationFlags
  422.     ENDIF
  423.  
  424.  
  425. ; ******************************************************************************
  426. ; **                                                                             **
  427. ; **                            Renderer Draw Region Tools                         **
  428. ; **                                                                             **
  429. ; ****************************************************************************
  430.  
  431.  
  432. ; typedef long                            TQ3XDevicePixelType
  433.                                                             ; These do not indicate byte ordering   
  434. kQ3XDevicePixelTypeInvalid        EQU        0                    ; Unknown, un-initialized type     
  435. kQ3XDevicePixelTypeRGB32        EQU        1                    ; Alpha:8 (ignored), R:8, G:8, B:8 
  436. kQ3XDevicePixelTypeARGB32        EQU        2                    ; Alpha:8, R:8, G:8, B:8              
  437. kQ3XDevicePixelTypeRGB24        EQU        3                    ; 24 bits/pixel, R:8, G:8, B:8     
  438. kQ3XDevicePixelTypeRGB16        EQU        4                    ; Alpha:1 (ignored), R:5, G:5, B:5 
  439. kQ3XDevicePixelTypeARGB16        EQU        5                    ; Alpha:1, R:5, G:5, B:5              
  440. kQ3XDevicePixelTypeRGB16_565    EQU        6                    ; 16 bits/pixel, R:5, G:6, B:5     
  441. kQ3XDevicePixelTypeIndexed8        EQU        7                    ; 8-bit color table index             
  442. kQ3XDevicePixelTypeIndexed4        EQU        8                    ; 4-bit color table index             
  443. kQ3XDevicePixelTypeIndexed2        EQU        9                    ; 2-bit color table index             
  444. kQ3XDevicePixelTypeIndexed1        EQU        10                    ; 1-bit color table index             
  445.  
  446. ; typedef long                            TQ3XClipMaskState
  447. kQ3XClipMaskFullyExposed        EQU        0
  448. kQ3XClipMaskPartiallyExposed    EQU        1
  449. kQ3XClipMaskNotExposed            EQU        2
  450. TQ3XColorDescriptor        RECORD 0
  451. redShift                 ds.l    1                ; offset: $0 (0)
  452. redMask                     ds.l    1                ; offset: $4 (4)
  453. greenShift                 ds.l    1                ; offset: $8 (8)
  454. greenMask                 ds.l    1                ; offset: $C (12)
  455. blueShift                 ds.l    1                ; offset: $10 (16)
  456. blueMask                 ds.l    1                ; offset: $14 (20)
  457. alphaShift                 ds.l    1                ; offset: $18 (24)
  458. alphaMask                 ds.l    1                ; offset: $1C (28)
  459. sizeof                     EQU *                    ; size:   $20 (32)
  460.                         ENDR
  461. TQ3XDrawRegionDescriptor RECORD 0
  462. width                     ds.l    1                ; offset: $0 (0)
  463. height                     ds.l    1                ; offset: $4 (4)
  464. rowBytes                 ds.l    1                ; offset: $8 (8)
  465. pixelSize                 ds.l    1                ; offset: $C (12)
  466. pixelType                 ds.l    1                ; offset: $10 (16)
  467. colorDescriptor             ds        TQ3XColorDescriptor ; offset: $14 (20)
  468. bitOrder                 ds.l    1                ; offset: $34 (52)
  469. byteOrder                 ds.l    1                ; offset: $38 (56)
  470. clipMask                 ds.l    1                ; offset: $3C (60)
  471. sizeof                     EQU *                    ; size:   $40 (64)
  472.                         ENDR
  473.  
  474. ; typedef long                            TQ3XDrawRegionServicesMasks
  475. kQ3XDrawRegionServicesNoneFlag    EQU        0
  476. kQ3XDrawRegionServicesClearFlag    EQU        $01
  477. kQ3XDrawRegionServicesDontLockDDSurfaceFlag EQU $02
  478. ; typedef unsigned long                 TQ3XDrawRegionServices
  479.  
  480. ;
  481. ; extern TQ3Status Q3XDrawRegion_GetDeviceScaleX(TQ3XDrawRegion drawRegion, float *deviceScaleX)
  482. ;
  483.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  484.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceScaleX
  485.     ENDIF
  486.  
  487. ;
  488. ; extern TQ3Status Q3XDrawRegion_GetDeviceScaleY(TQ3XDrawRegion drawRegion, float *deviceScaleY)
  489. ;
  490.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  491.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceScaleY
  492.     ENDIF
  493.  
  494.  
  495. ;
  496. ; extern TQ3Status Q3XDrawRegion_GetDeviceOffsetX(TQ3XDrawRegion drawRegion, float *deviceOffsetX)
  497. ;
  498.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  499.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceOffsetX
  500.     ENDIF
  501.  
  502. ;
  503. ; extern TQ3Status Q3XDrawRegion_GetDeviceOffsetY(TQ3XDrawRegion drawRegion, float *deviceOffsetX)
  504. ;
  505.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  506.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceOffsetY
  507.     ENDIF
  508.  
  509.  
  510. ;
  511. ; extern TQ3Status Q3XDrawRegion_GetWindowScaleX(TQ3XDrawRegion drawRegion, float *windowScaleX)
  512. ;
  513.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  514.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetWindowScaleX
  515.     ENDIF
  516.  
  517. ;
  518. ; extern TQ3Status Q3XDrawRegion_GetWindowScaleY(TQ3XDrawRegion drawRegion, float *windowScaleY)
  519. ;
  520.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  521.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetWindowScaleY
  522.     ENDIF
  523.  
  524.  
  525. ;
  526. ; extern TQ3Status Q3XDrawRegion_GetWindowOffsetX(TQ3XDrawRegion drawRegion, float *windowOffsetX)
  527. ;
  528.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  529.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetWindowOffsetX
  530.     ENDIF
  531.  
  532. ;
  533. ; extern TQ3Status Q3XDrawRegion_GetWindowOffsetY(TQ3XDrawRegion drawRegion, float *windowOffsetY)
  534. ;
  535.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  536.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetWindowOffsetY
  537.     ENDIF
  538.  
  539. ;
  540. ; extern TQ3Status Q3XDrawRegion_IsActive(TQ3XDrawRegion drawRegion, TQ3Boolean *isActive)
  541. ;
  542.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  543.         IMPORT_CFM_FUNCTION Q3XDrawRegion_IsActive
  544.     ENDIF
  545.  
  546.  
  547. ;
  548. ; extern TQ3Status Q3XDrawRegion_GetNextRegion(TQ3XDrawRegion drawRegion, TQ3XDrawRegion *nextDrawRegion)
  549. ;
  550.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  551.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetNextRegion
  552.     ENDIF
  553.  
  554. ;  
  555. ; *  One of the next two functions must be called before using a draw region 
  556.  
  557. ; *    Use this Start function if double buffering/image access services from the
  558. ; *    Draw Context are not needed, you may still request clear for example
  559.  
  560. ;
  561. ; extern TQ3Status Q3XDrawRegion_Start(TQ3XDrawRegion drawRegion, TQ3XDrawRegionServices services, TQ3XDrawRegionDescriptor **descriptor)
  562. ;
  563.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  564.         IMPORT_CFM_FUNCTION Q3XDrawRegion_Start
  565.     ENDIF
  566.  
  567. ; *    Use this Start function if double buffering or image access services from 
  568. ; *  the Draw Context are needed.
  569.  
  570. ;
  571. ; extern TQ3Status Q3XDrawRegion_StartAccessToImageBuffer(TQ3XDrawRegion drawRegion, TQ3XDrawRegionServices services, TQ3XDrawRegionDescriptor **descriptor, void **image)
  572. ;
  573.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  574.         IMPORT_CFM_FUNCTION Q3XDrawRegion_StartAccessToImageBuffer
  575.     ENDIF
  576.  
  577. ; *    This function is used to indicate that access to a DrawRegion is ended.
  578.  
  579. ;
  580. ; extern TQ3Status Q3XDrawRegion_End(TQ3XDrawRegion drawRegion)
  581. ;
  582.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  583.         IMPORT_CFM_FUNCTION Q3XDrawRegion_End
  584.     ENDIF
  585.  
  586. ;
  587. ; extern TQ3Status Q3XDrawRegion_GetDeviceTransform(TQ3XDrawRegion drawRegion, TQ3Matrix4x4 **deviceTransform)
  588. ;
  589.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  590.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetDeviceTransform
  591.     ENDIF
  592.  
  593. ;
  594. ; extern TQ3Status Q3XDrawRegion_GetClipFlags(TQ3XDrawRegion drawRegion, TQ3XClipMaskState *clipMaskState)
  595. ;
  596.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  597.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetClipFlags
  598.     ENDIF
  599.  
  600. ;
  601. ; extern TQ3Status Q3XDrawRegion_GetClipMask(TQ3XDrawRegion drawRegion, TQ3Bitmap **clipMask)
  602. ;
  603.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  604.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetClipMask
  605.     ENDIF
  606.  
  607.     IF TARGET_OS_MAC THEN
  608. ;
  609. ; extern TQ3Status Q3XDrawRegion_GetClipRegion(TQ3XDrawRegion drawRegion, RgnHandle *rgnHandle)
  610. ;
  611.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  612.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetClipRegion
  613.     ENDIF
  614.  
  615. ;
  616. ; extern TQ3Status Q3XDrawRegion_GetGDHandle(TQ3XDrawRegion drawRegion, GDHandle *gdHandle)
  617. ;
  618.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  619.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetGDHandle
  620.     ENDIF
  621.  
  622.     ENDIF    ; TARGET_OS_MAC
  623. ;
  624. ; extern TQ3Status Q3XDrawRegion_GetRendererPrivate(TQ3XDrawRegion drawRegion, void **rendererPrivate)
  625. ;
  626.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  627.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetRendererPrivate
  628.     ENDIF
  629.  
  630. ;
  631. ; extern TQ3Status Q3XDrawRegion_SetRendererPrivate(TQ3XDrawRegion drawRegion, const void *rendererPrivate, TQ3XDrawRegionRendererPrivateDeleteMethod deleteMethod)
  632. ;
  633.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  634.         IMPORT_CFM_FUNCTION Q3XDrawRegion_SetRendererPrivate
  635.     ENDIF
  636.  
  637. ;
  638. ; extern TQ3Status Q3XDrawRegion_SetUseDefaultRendererFlag(TQ3XDrawRegion drawRegion, TQ3Boolean flag)
  639. ;
  640.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  641.         IMPORT_CFM_FUNCTION Q3XDrawRegion_SetUseDefaultRendererFlag
  642.     ENDIF
  643.  
  644. ;
  645. ; extern TQ3Status Q3XDrawRegion_GetUseDefaultRendererFlag(TQ3XDrawRegion drawRegion, TQ3Boolean *useDefaultRenderingFlag)
  646. ;
  647.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  648.         IMPORT_CFM_FUNCTION Q3XDrawRegion_GetUseDefaultRendererFlag
  649.     ENDIF
  650.  
  651.  
  652.  
  653. ; ******************************************************************************
  654. ; **                                                                             **
  655. ; **                            Renderer Class Methods                             **
  656. ; **                                                                             **
  657. ; ****************************************************************************
  658.  
  659. ; *    Methods from Object
  660. ; *        kQ3XMethodTypeObjectClassRegister
  661. ; *        kQ3XMethodTypeObjectClassUnregister
  662. ; *        kQ3XMethodTypeObjectNew
  663. ; *        kQ3XMethodTypeObjectDelete
  664. ; *        kQ3XMethodTypeObjectRead
  665. ; *        kQ3XMethodTypeObjectTraverse
  666. ; *        kQ3XMethodTypeObjectWrite
  667. ; *        
  668. ; *    Methods from Shared
  669. ; *        kQ3MethodTypeSharedEdited
  670. ; *
  671. ; *    Renderer Methods
  672. ; *    
  673. ; *    The renderer methods should be implemented according to the type
  674. ; *    of renderer being written.
  675. ; *
  676. ; *    For the purposes of documentation, there are two basic types of
  677. ; *    renderers: 
  678. ; *
  679. ; *        Interactive
  680. ; *            Interactive Renderer
  681. ; *            WireFrame Renderer
  682. ; *        
  683. ; *        Deferred
  684. ; *            a ray-tracer
  685. ; *            painter's algorithm renderer (cached in a BSP triangle tree)
  686. ; *            an artistic renderer (simulates a pencil drawing, etc.)
  687. ; *
  688. ; *    The main difference is how each renderer handles incoming state and 
  689. ; *    geometry.
  690. ; *
  691. ; *    An interactive renderer immediately transforms, culls, and shades
  692. ; *    incoming geometry and performs rasterization. For example, in a 
  693. ; *    single-buffered WireFrame renderer, you will see a new triangle
  694. ; *    immediately after Q3Triangle_Draw (if it's visible, of course).
  695. ; *
  696. ; *    A deferred renderer caches the view state and each geometry, 
  697. ; *    converting into any internal queue of drawing commands. Rasterization
  698. ; *    is not actually performed until all data has been submitted.
  699. ; *    
  700. ; *    For example, a ray-tracer may not rasterize anything until the
  701. ; *    end of the rendering loop, or until an EndFrame call is made.
  702.  
  703.  
  704. ; ******************************************************************************
  705. ; **                                                                             **
  706. ; **                        Renderer User Interface Methods                         **
  707. ; **                                                                             **
  708. ; ****************************************************************************
  709.  
  710. ; *    kQ3XMethodTypeRendererIsInteractive
  711. ; *    
  712. ; *    There is no actual method with this - the metahandler simply returns
  713. ; *  "(TQ3XFunctionPointer)kQ3True" for this "method" if the renderer is 
  714. ; *  intended to be used in interactive settings, and   
  715. ; *    "(TQ3XFunctionPointer)kQ3False" otherwise. 
  716. ; *  
  717. ; *  If neither value is specified in the metahandler, the renderer 
  718. ; *  is *assumed to be non-interactive*!!!
  719. ; *    
  720. ; *    OPTIONAL
  721.  
  722.  
  723. kQ3XMethodTypeRendererIsInteractive EQU    'isin'
  724.  
  725. ; *    TQ3XRendererModalConfigureMethod
  726. ; *    
  727. ; *    This method should pop up a modal dialog to edit the renderer settings 
  728. ; *    found in the renderer private. 
  729. ; *    
  730. ; *    dialogAnchor - is platform specific data passed by the client to support
  731. ; *      movable modal dialogs. 
  732. ; *    MacOS: this is a callback to the calling application's event handler.
  733. ; *      The renderer calls this function with events not handled by the 
  734. ; *      settings dialog. This is necessary in order to support movable modal 
  735. ; *      dialogs. An application's event handler must return kQ3True if it 
  736. ; *      handles the event passed to the callback or kQ3False if not. 
  737. ; *      An application which doesn't want to support a movable modal configure
  738. ; *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  739. ; *      A renderer should implement a non-movable style dialog in that case.
  740. ; *    Win32: this is the HWND of the owning window (typically an application's
  741. ; *      main window).  (Win32 application modal dialogs are always movable.)
  742. ; *  canceled - returns a boolean inditacating that the user canceled the 
  743. ; *    dialog.
  744. ; *    
  745. ; *    OPTIONAL
  746.  
  747.  
  748. kQ3XMethodTypeRendererModalConfigure EQU 'rdmc'
  749. ; *    kQ3XMethodTypeRendererGetNickNameString
  750. ; *    
  751. ; *        Allows an application to collect the name of the renderer for
  752. ; *        display in a user interface item such as a menu.
  753. ; *    
  754. ; *        If dataBuffer is NULL actualDataSize returns the required size in 
  755. ; *        bytes of a data buffer large enough to store the renderer name. 
  756. ; *
  757. ; *      bufferSize is the actual size of the memory block pointed to by 
  758. ; *        dataBuffer
  759. ; *
  760. ; *        actualDataSize - on return the actual number of bytes written to the
  761. ; *        buffer or if dataBuffer is NULL the required size of dataBuffer
  762. ; *
  763. ; *    OPTIONAL
  764.  
  765.  
  766. kQ3XMethodTypeRendererGetNickNameString EQU 'rdns'
  767. ; *    kQ3XMethodTypeRendererGetConfigurationData
  768. ; *    
  769. ; *        Allows an application to collect private configuration data from the
  770. ; *      renderer which it will then save. For example in a preference file, 
  771. ; *      a registry key (on Windows) or in a style template. An application 
  772. ; *      should tag this data with the renderer's object name.
  773. ; *    
  774. ; *        If dataBuffer is NULL actualDataSize returns the required size in 
  775. ; *        bytes of a data buffer large enough to store private data. 
  776. ; *
  777. ; *      bufferSize is the actual size of the memory block pointed to by 
  778. ; *        dataBuffer
  779. ; *
  780. ; *        actualDataSize - on return the actual number of bytes written to the
  781. ; *        buffer or if dataBuffer is NULL the required size of dataBuffer
  782. ; *
  783. ; *    OPTIONAL
  784.  
  785.  
  786. kQ3XMethodTypeRendererGetConfigurationData EQU 'rdgp'
  787. ; *    TQ3XRendererSetConfigurationDataMethod
  788. ; *    
  789. ; *        Allows an application to pass private configuration data which has
  790. ; *         previously  been obtained from a renderer via 
  791. ; *        Q3Renderer_GetConfigurationData. For example in a preference file or 
  792. ; *        in a style template. An application should tag this data with the 
  793. ; *        renderer's object name.
  794. ; *    
  795. ; *      bufferSize is the actual size of the memory block pointed to by 
  796. ; *        dataBuffer
  797. ; *
  798. ; *    OPTIONAL
  799.  
  800.  
  801. kQ3XMethodTypeRendererSetConfigurationData EQU 'rdsp'
  802. ; ******************************************************************************
  803. ; **                                                                             **
  804. ; **                        Renderer Drawing State Methods                         **
  805. ; **                                                                             **
  806. ; ****************************************************************************
  807.  
  808. ; *    TQ3RendererStartFrame
  809. ; *    
  810. ; *    The StartFrame method is called first at Q3View_StartRendering
  811. ; *    and should:
  812. ; *        - initialize any renderer state to defaults
  813. ; *        - extract any and all useful data from the drawContext
  814. ; *
  815. ; *    If your renderer passed in kQ3RendererFlagClearBuffer at 
  816. ; *    registration, then it should also:
  817. ; *        - clear the drawContext 
  818. ; *    
  819. ; *        When clearing, your renderer may opt to:
  820. ; *        - NOT clear anything (if you touch every pixel, for example)
  821. ; *        - to clear with your own routine, or
  822. ; *        - to use the draw context default clear method by calling 
  823. ; *        Q3DrawContext_Clear. Q3DrawContext_Clear takes advantage of
  824. ; *        any available hardware in the system for clearing.
  825. ; *    
  826. ; *    This call also signals the start of all default submit commands from
  827. ; *    the view. The renderer will receive updates for the default view
  828. ; *    state via its Update methods before StartPass is called.
  829. ; *    
  830. ; *    REQUIRED
  831.  
  832.  
  833. kQ3XMethodTypeRendererStartFrame EQU    'rdcl'
  834. ; *    kQ3XMethodTypeRendererStartPass
  835. ; *    TQ3XRendererStartPassMethod
  836. ; *    
  837. ; *    The StartPass method is called during Q3View_StartRendering but after
  838. ; *    the StartFrame command. It should:
  839. ; *        - collect camera and light information
  840. ; *    
  841. ; *    If your renderer supports deferred camera transformation, camera is the
  842. ; *    main camera which will be submitted in the hierarchy somewhere. It
  843. ; *    is never NULL.
  844. ; *
  845. ; *    If your renderer does not support deferred camera transformation, camera
  846. ; *    is the transformed camera.
  847. ; *
  848. ; *    If your renderer supports deferred light transformation, lights will be
  849. ; *    NULL, and will be submitted to your light draw methods instead.
  850. ; *
  851. ; *    This call signals the end of the default update state, and the start of 
  852. ; *  submit commands from the user to the view.
  853. ; *
  854. ; *    REQUIRED
  855.  
  856.  
  857. kQ3XMethodTypeRendererStartPass    EQU        'rdst'
  858. ; *    kQ3XMethodTypeRendererFlushFrame
  859. ; *    TQ3XRendererFlushFrameMethod
  860. ; *    
  861. ; *    This call is only implemented by asynchronous renderers.
  862. ; *    
  863. ; *    The FlushFrame method is called between the StartPass and EndPass
  864. ; *    methods and is called when the user wishes to flush any asynchronous
  865. ; *    drawing tasks (which draw to the drawcontext), but does not want 
  866. ; *    to block.
  867. ; *    
  868. ; *    The result of this call is that an image should "eventually" appear
  869. ; *    asynchronously.
  870. ; *    
  871. ; *    For asynchronous rendering, this call is non-blocking.
  872. ; *    
  873. ; *    An interactive renderer should ensure that all received
  874. ; *    geometries are drawn in the image.
  875. ; *    
  876. ; *    An interactive renderer that talks to hardware should force
  877. ; *    the hardware to generate an image.
  878. ; *    
  879. ; *    A deferred renderer should exhibit a similar behaviour,
  880. ; *    though it is not required.  A deferred renderer should spawn
  881. ; *    a process that generates a partial image from the currently
  882. ; *    accumulated drawing state. 
  883. ; *    
  884. ; *    However, for renderers such as ray-tracers which generally are
  885. ; *    quite compute-intensive, FlushFrame is not required and is a no-op.
  886. ; *
  887. ; *    OPTIONAL
  888.  
  889.  
  890. kQ3XMethodTypeRendererFlushFrame EQU    'rdfl'
  891. ; *    kQ3XMethodTypeRendererEndPass
  892. ; *    TQ3XRendererEndPassMethod
  893. ; *    
  894. ; *    The EndPass method is called at Q3View_EndRendering and signals
  895. ; *    the end of submit commands to the view.
  896. ; *
  897. ; *    If an error occurs, the renderer should call Q3XError_Post and
  898. ; *    return kQ3ViewStatusError.
  899. ; *    
  900. ; *    If a renderer requires another pass on the renderering data,
  901. ; *    it should return kQ3ViewStatusRetraverse.
  902. ; *    
  903. ; *    If rendering was cancelled, this function will not be called
  904. ; *    and the view will handle returning kQ3ViewStatusCancelled;
  905. ; *    
  906. ; *    Otherwise, your renderer should begin completing the process of 
  907. ; *    generating the image in the drawcontext. If you have buffered
  908. ; *    any drawing data, flush it. RendererEnd should have a similar
  909. ; *    effect as RendererFlushFrame.
  910. ; *    
  911. ; *    If the renderer is synchronous:
  912. ; *        - complete rendering of the entire frame
  913. ; *        if the renderer supports kQ3RendererClassSupportDoubleBuffer
  914. ; *            - Update the front buffer
  915. ; *        else
  916. ; *            - DrawContext will update the front buffer after returning
  917. ; *
  918. ; *    If the renderer is asynchronous
  919. ; *        - spawn rendering thread for entire frame
  920. ; *        if the renderer supports kQ3RendererClassSupportDoubleBuffer,
  921. ; *            - you must eventually update the front buffer asynchronously
  922. ; *        else
  923. ; *            - you must eventually update the back buffer asynchronously
  924. ; *            
  925. ; *    REQUIRED
  926.  
  927.  
  928. kQ3XMethodTypeRendererEndPass    EQU        'rded'
  929. ; *    kQ3XMethodTypeRendererEndFrame
  930. ; *    TQ3XRendererEndFrame
  931. ; *    
  932. ; *    This call is only implemented by asynchronous renderers.
  933. ; *
  934. ; *    The EndFrame method is called from Q3View_Sync, which is
  935. ; *    called after Q3View_EndRendering and signals that the user
  936. ; *    wishes to see the completed image and is willing to block.
  937. ; *    
  938. ; *    If your renderer supports kQ3RendererFlagDoubleBuffer
  939. ; *        - update the front buffer completely 
  940. ; *    else
  941. ; *        - update the back buffer completely
  942. ; *
  943. ; *    This call is equivalent in functionality to RendererFlushFrame
  944. ; *    but blocks until the image is completed.
  945. ; *    
  946. ; *    If no method is supplied, the default is a no-op.
  947. ; *    
  948. ; *    NOTE: Registering a method of this type indicates that your renderer will
  949. ; *    be rendering after Q3View_EndRendering has been called.
  950. ; *    
  951. ; *    OPTIONAL
  952.  
  953.  
  954. kQ3XMethodTypeRendererEndFrame    EQU        'rdsy'
  955. ; *    The RendererCancel method is called after Q3View_StartRendering
  956. ; *    and signals the termination of all rendering operations.
  957. ; *
  958. ; *    A renderer should clean up any cached data, and cancel all 
  959. ; *    rendering operations.
  960. ; *    
  961. ; *    If called before Q3View_EndRendering, the RendererEnd method
  962. ; *    is NOT called.
  963. ; *    
  964. ; *    If called after Q3View_EndRendering, the renderer should kill
  965. ; *    any threads and terminate any further rendering.
  966. ; *    
  967. ; *    REQUIRED
  968.  
  969.  
  970. kQ3XMethodTypeRendererCancel    EQU        'rdab'
  971. ; ******************************************************************************
  972. ; **                                                                             **
  973. ; **                        Renderer DrawContext Methods                         **
  974. ; **                                                                             **
  975. ; ****************************************************************************
  976.  
  977. ; *    kQ3XMethodTypeRendererPush
  978. ; *    TQ3XRendererPushMethod
  979. ; *    
  980. ; *    kQ3XMethodTypeRendererPop
  981. ; *    TQ3XRendererPopMethod
  982. ; *    
  983. ; *    These methods are called whenever the graphics state in the view
  984. ; *    is pushed or popped. The user may isolate state by calling:
  985. ; *    
  986. ; *    Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &red, view);
  987. ; *    Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &blue, view);
  988. ; *    Q3Attribute_Submit(kQ3AttributeTypeSpecularColor, &white, view);
  989. ; *    Q3Box_Submit(&unitBox, view);
  990. ; *    Q3TranslateTransform_Submit(&unitVector, view);
  991. ; *    Q3Push_Submit(view);
  992. ; *        Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &blue, view);
  993. ; *        Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &green, view);
  994. ; *        Q3Box_Submit(&unitBox, view);
  995. ; *    Q3Pop_Submit(view);    
  996. ; *    Q3TranslateTransform_Submit(&unitVector, view);
  997. ; *    Q3Box_Submit(&unitBox, view);
  998. ; *    
  999. ; *    or by submitting a display group which pushes and pops.
  1000. ; *    
  1001. ; *    If you support RendererPush and RendererPop in your renderer:
  1002. ; *        - you must maintain your drawing state as a stack, as well.
  1003. ; *        - you will not be updated with the popped state after
  1004. ; *            RendererPop is called.
  1005. ; *
  1006. ; *    If you do not support Push and Pop in your renderer:
  1007. ; *        - you may maintain a single copy of the drawing state.
  1008. ; *        - you will be updated with changed fields after the view stack is
  1009. ; *            popped.
  1010. ; *
  1011. ; *    A renderer that supports Push and Pop gets called in the following
  1012. ; *    sequence (from example above):
  1013. ; *    
  1014. ; *    RendererUpdateAttributeDiffuseColor(&red,...)
  1015. ; *    RendererUpdateAttributeTransparencyColor(&blue,...)
  1016. ; *    RendererUpdateAttributeSpecularColor(&white,...)
  1017. ; *    RendererUpdateMatrixLocalToWorld(...)
  1018. ; *    RendererSubmitGeometryBox(...)
  1019. ; *    RendererPush(...)
  1020. ; *        RendererUpdateAttributeDiffuseColor(&blue,...)
  1021. ; *        RendererUpdateAttributeTransparencyColor(&green,...)
  1022. ; *        RendererSubmitGeometryBox(...)
  1023. ; *    RendererPop(...)
  1024. ; *    RendererUpdateMatrixLocalToWorld(...)
  1025. ; *    RendererSubmitGeometryBox(...)
  1026. ; *
  1027. ; *    A renderer that does not supports Push and Pop gets called in the
  1028. ; *    following sequence:
  1029. ; *    
  1030. ; *    RendererUpdateAttributeDiffuseColor(&red,...)
  1031. ; *    RendererUpdateAttributeTransparencyColor(&blue,...)
  1032. ; *    RendererUpdateAttributeSpecularColor(&white,...)
  1033. ; *    RendererUpdateMatrixLocalToWorld(...)
  1034. ; *    RendererSubmitGeometryBox(...)
  1035. ; *        RendererUpdateAttributeDiffuseColor(&blue,...)
  1036. ; *        RendererUpdateAttributeTransparencyColor(&green,...)
  1037. ; *        RendererSubmitGeometryBox(...)
  1038. ; *    RendererUpdateAttributeDiffuseColor(&red,...)
  1039. ; *    RendererUpdateAttributeTransparencyColor(&blue,...)
  1040. ; *    RendererUpdateMatrixLocalToWorld(...)
  1041. ; *    RendererSubmitGeometryBox(...)
  1042. ; *    
  1043.  
  1044.  
  1045. kQ3XMethodTypeRendererPush        EQU        'rdps'
  1046.  
  1047. kQ3XMethodTypeRendererPop        EQU        'rdpo'
  1048. ; ******************************************************************************
  1049. ; **                                                                             **
  1050. ; **                            Renderer Cull Methods                             **
  1051. ; **                                                                             **
  1052. ; ****************************************************************************
  1053.  
  1054. ; *    kQ3XMethodTypeRendererIsBoundingBoxVisible
  1055. ; *    TQ3XRendererIsBoundingBoxVisibleMethod
  1056. ; *    
  1057. ; *    This method is called to cull complex groups and geometries 
  1058. ; *    given their bounding box in local space.
  1059. ; *    
  1060. ; *    It should transform the local-space bounding box coordinates to
  1061. ; *    frustum space and return a TQ3Boolean return value indicating
  1062. ; *    whether the box appears within the viewing frustum.
  1063. ; *    
  1064. ; *    If no method is supplied, the default behavior is to return
  1065. ; *    kQ3True.
  1066. ; *    
  1067.  
  1068.  
  1069. kQ3XMethodTypeRendererIsBoundingBoxVisible EQU 'rdbx'
  1070.  
  1071. ; ******************************************************************************
  1072. ; **                                                                             **
  1073. ; **                        Renderer Object Support Methods                         **
  1074. ; **                                                                             **
  1075. ; ****************************************************************************
  1076.  
  1077. ; *    Drawing methods (Geometry, Camera, Lights)
  1078. ; *
  1079.  
  1080. ; *    Geometry MetaHandler
  1081. ; *    
  1082. ; *    This metaHandler is required to support 
  1083. ; *    
  1084. ; *    kQ3GeometryTypeTriangle
  1085. ; *    kQ3GeometryTypeLine
  1086. ; *    kQ3GeometryTypePoint
  1087. ; *    kQ3GeometryTypeMarker
  1088. ; *    kQ3GeometryTypePixmapMarker
  1089. ; *    
  1090. ; *    REQUIRED
  1091.  
  1092.  
  1093. kQ3XMethodTypeRendererSubmitGeometryMetaHandler EQU 'rdgm'
  1094. ; *    The TQ3XRendererSubmitGeometryMetaHandlerMethod switches on geometryType
  1095. ; *    of kQ3GeometryTypeFoo and returns methods of type:
  1096.  
  1097. ; *    Camera MetaHandler
  1098. ; *    
  1099. ; *    This metaHandler, if supplied, indicates that your renderer
  1100. ; *    handles deferred transformation of the main camera within a scene.
  1101. ; *    
  1102. ; *    If not supplied, or an unsupported camera is used, the view will do
  1103. ; *    the transformation for the renderer and pass in a camera in the 
  1104. ; *    StartPass method.
  1105. ; *    
  1106. ; *    OPTIONAL
  1107.  
  1108.  
  1109. kQ3XMethodTypeRendererSubmitCameraMetaHandler EQU 'rdcm'
  1110. ; *    The TQ3XRendererSubmitCameraMetaHandlerMethod switches on cameraType
  1111. ; *    of kQ3CameraTypeFoo and returns methods of type:
  1112.  
  1113. ; *    Light MetaHandler
  1114. ; *    
  1115. ; *    This metaHandler, if supplied, indicates that your renderer
  1116. ; *    handles deferred transformation of lights within a scene.
  1117. ; *    
  1118. ; *    If an unsupported light is encountered, it is ignored.
  1119. ; *
  1120. ; *    OPTIONAL
  1121.  
  1122.  
  1123. kQ3XMethodTypeRendererSubmitLightMetaHandler EQU 'rdlg'
  1124. ; *    The TQ3XRendererSubmitLightMetaHandlerMethod switches on lightType
  1125. ; *    of kQ3LightTypeFoo and returns methods of type:
  1126.  
  1127. ; *
  1128. ; *    Update methods
  1129. ; *
  1130. ; *    They are called whenever the state has changed. If the renderer supports
  1131. ; *    the RendererPush and RendererPop methods, it must maintain its own state
  1132. ; *    stack. Updates are not called for changed data when the view stack is
  1133. ; *    popped.
  1134. ; *
  1135. ; *    See the comments for the RendererPush and RendererPop methods above
  1136. ; *    for an example of how data is updated.
  1137. ; *
  1138.  
  1139. ; *    Style
  1140.  
  1141.  
  1142. kQ3XMethodTypeRendererUpdateStyleMetaHandler EQU 'rdyu'
  1143. ; *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on styleType
  1144. ; *    of kQ3StyleTypeFoo and returns methods of type:
  1145.  
  1146. ; *    Attributes
  1147.  
  1148.  
  1149. kQ3XMethodTypeRendererUpdateAttributeMetaHandler EQU 'rdau'
  1150. ; *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on attributeType
  1151. ; *    of kQ3AttributeTypeFoo and returns methods of type:
  1152.  
  1153. ; *    Shaders
  1154.  
  1155.  
  1156. kQ3XMethodTypeRendererUpdateShaderMetaHandler EQU 'rdsu'
  1157. ; *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on shaderType
  1158. ; *    of kQ3ShaderTypeFoo and returns methods of type:
  1159.  
  1160. ; *    Matrices
  1161.  
  1162.  
  1163. kQ3XMethodTypeRendererUpdateMatrixMetaHandler EQU 'rdxu'
  1164. ; typedef TQ3XMetaHandler                 TQ3XRendererUpdateMatrixMetaHandlerMethod
  1165.  
  1166. ; *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on methods
  1167. ; *    of the form kQ3MethodTypeRendererUpdateMatrixFoo:
  1168.  
  1169.  
  1170. kQ3XMethodTypeRendererUpdateMatrixLocalToWorld EQU 'ulwx'
  1171.  
  1172. kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverse EQU 'ulwi'
  1173.  
  1174. kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverseTranspose EQU 'ulwt'
  1175.  
  1176. kQ3XMethodTypeRendererUpdateMatrixLocalToCamera EQU 'ulcx'
  1177.  
  1178. kQ3XMethodTypeRendererUpdateMatrixLocalToFrustum EQU 'ulfx'
  1179.  
  1180. kQ3XMethodTypeRendererUpdateMatrixWorldToFrustum EQU 'uwfx'
  1181. ; *    and returns methods of type:
  1182.  
  1183.  
  1184.     ENDIF ; __QD3DRENDERER__ 
  1185.  
  1186.